# http方法: 浏览器对web服务发起请求 分两种常用的请求: get请求 post请求
# 直接通过浏览器的地址栏对web服务发起的请求是get请求!!!


from flask import Flask,request
app = Flask(__name__)

#默认情况下路由只支持get请求
@app.route('/')
def index():
    return 'Hello World!!!'

#处理登录业务
@app.route('/login', methods=['GET',"POST"])
def login():
    # username = request.args.get('username')
    # password = request.args.get('psd')
    username = request.form.get('username')
    password = request.form.get('psd')
    print(username,password)
    return 'login'

if __name__ == '__main__':
    app.run(debug=True,port=8989)